package com.genersoft.iot.vmp.rabbitmq.provider;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceMsg;
import com.genersoft.iot.vmp.rabbitmq.config.ExchangeName;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author WangPing
 * @Date 2024/10/23
 **/
@Component
public class RabbitmqProvider {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void convertAndSend(String exchange, String routingKey, Device device, String deviceType) {
        DeviceMsg deviceMsg = new DeviceMsg();
        deviceMsg.setTimestamp(System.currentTimeMillis());
        deviceMsg.setDeviceCode(device.getDeviceId());
        deviceMsg.setDeviceType(deviceType);
        /*rabbitTemplate.convertAndSend(exchange, routingKey, deviceMsg);*/
    }

}
